function ModuleDialogPickDesigner(doc, container, width, height, user, date, options) {
  this._doc = doc;
  this._container = container;
  this._width = width;
  this._height = height;
  this._user = user;
  this._date = date;
  this._options = options;
  
  this._object = (options && options.object) ? options.object : {};

  this._createElements();
};

ModuleDialogPickDesigner.prototype._createElements = function() {
  var unique = MiscUtils.unique(), _self = this;
  this._gui = new DialogPickDesigner(this._doc, this._container, this._width, this._height, this._user, this._date, this._options)._gui;

  this._loadData();
};

ModuleDialogPickDesigner.prototype._loadData = function() {
  DOMUtils.removeChildElements(this._gui.users);
  this._gui.users.appendChild(DOMUtils.getLoadingImage());
  
  this._users = null;
  this._retrieveUsers();
};

ModuleDialogPickDesigner.prototype._verifyData = function() {
  if (this._users) {
      this._updateElements();
  }
};

ModuleDialogPickDesigner.prototype._retrieveUsers = function() {
  var _self = this;
  new RequestUtils()._read('pz_user', null, 'd.type=\'' + Constant.USER_TYPE_DESIGNER + '\'', null, null, null, null, function(result, params) { _self._users = result.data;
                                                                                                                                                 _self._verifyData.call(_self);
                                                                                                                                               }, null);
};

ModuleDialogPickDesigner.prototype._updateElements = function() {
  var table, tr, td, radio, input, unique = MiscUtils.unique(), _self = this;
  DOMUtils.removeChildElements(this._gui.users);

  table = document.createElement('table');
  table.cellPadding = 0;
  table.cellSpacing = 0;
  table.style.width = '280px';
  this._gui.users.appendChild(table);
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.textAlign = 'center';
  td.style.fontWeight = 'bold';
  td.style.fontSize = '13px';
  td.colSpan=2;
  td.style.padding = '10px 0 6px';
  td.appendChild(document.createTextNode('Designer List'));
  
  tr = table.insertRow(-1);
  td = tr.insertCell(-1);
  td.style.width = '280px';
  var mains = document.createElement('table');
  mains.cellPadding = 0;
  mains.cellSpacing = 0;
  mains.className = "tableborder";
  mains.style.width = '280px';
  td.appendChild(mains);
  
  tr = mains.insertRow(-1);
  tr.style.backgroundColor = '#dbe7fc';
  td = tr.insertCell(-1);
  td.style.height = '23px';
  
  td = tr.insertCell(-1);
  td.style.width = '100%';
  td.style.paddingLeft = '5px';
  td.style.fontWeight = 'bold';
  td.style.textAlign = 'left';
  td.appendChild(document.createTextNode('Designer'));
  
  if (this._users.length == 0) {
    tr = mains.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 2;
    td.style.height = '23px';
    td.style.padding = '0 5px';
    td.style.textAlign = 'left';
    td.appendChild(document.createTextNode('n/a'))
  }
  
  if (this._object.designer_id && this._object.designer_id == 0 && this._users.length != 0) {
    this._object.designer_id = this._users[0].id;
  }
  
  for (var i = 0, il = this._users.length; i < il; i++) {
    var u = this._users[i];
    tr = mains.insertRow(-1);
    td = tr.insertCell(-1);
    td.style.padding = '0 5px';
    td.style.height = '23px';
    radio = DOMUtils.createInput(unique + '_assignee', null, 'radio', null, null);
    radio.checked = (this._object.designer_id == u.id);
    radio._user = u;
    if (radio.checked) {
      this._object.designer_id = u.id;
      this._object.designer = u.name;
    }
    radio.onclick = function() { _self._object.designer_id = this._user.id;
                                 _self._object.designer = this._user.name;
                               };
    td.appendChild(radio);
    
    td = tr.insertCell(-1);
    td.style.padding = '0 5px';
    td.style.height = '23px';
    td.style.textAlign = 'left';
    td.appendChild(document.createTextNode(u.account));
  }

};
